/***********************************************************
 * Product Name: ExcelQuicker
 * Copyright (c)2005, Eunge
 * Author: Eunge
 * Web Site: www.eudev.net
 * Mail/MSN: eudev.net@yeah.net
 * ********************************************************/
using System;
using System.Collections;

namespace ExcelQuicker.Framework
{
	/// <summary>
	/// Collection of EQStyleBase
	/// </summary>
	[Serializable]
	sealed public class EQStyleBaseCollection: EQCollection  	
	{
		/// <summary>
		/// Add a new object derived from EQStyleBase
		/// </summary>
		/// <param name="objEQStyleBase"></param>
		public void Add(EQStyleBase objEQStyleBase)
		{
			base.Add(objEQStyleBase);
		}

		/// <summary>
		/// Remove object derived from EQStyleBase
		/// </summary>
		/// <param name="objEQStyleBase"></param>
		public void Remove(EQStyleBase objEQStyleBase)
		{
			base.Remove(objEQStyleBase);
		}

		/// <summary>
		/// Add a new object derived from EQStyleBase at specialized position
		/// </summary>
		/// <param name="index"></param>
		/// <param name="objEQStyleBase"></param>
		public void Insert(int index, EQStyleBase objEQStyleBase)
		{
			base.Insert(index, objEQStyleBase);
		}

		/// <summary>
		/// Get the index of objEQStyleBase in current collection
		/// </summary>
		/// <param name="objEQStyleBase"></param>
		/// <returns></returns>
		public int IndexOf(EQStyleBase objEQStyleBase)
		{
			return base.IndexOf(objEQStyleBase);
		}

		/// <summary>
		/// Check the objEQStyleBase whether exists in the current collection
		/// </summary>
		/// <param name="objEQStyleBase"></param>
		/// <returns></returns>
		public bool Contains(EQStyleBase objEQStyleBase)
		{
			return base.Contains(objEQStyleBase);
		}

		/// <summary>
		/// Set/Get EQStyleBase object by setting index
		/// </summary>
		public new EQStyleBase this[int index]
		{
			get
			{
				return base[index] as EQStyleBase;
			}
			set
			{
				base[index] = value;
			}
		}

		/// <summary>
		/// Copy the object which its index more from index to objEQStyleBaseCollection
		/// </summary>
		/// <param name="objEQStyleBaseCollection"></param>
		/// <param name="index"></param>
		public void CopyTo(EQStyleBaseCollection objEQStyleBaseCollection, int index)
		{
			base.CopyTo(objEQStyleBaseCollection, index);
		}		

		/// <summary>
		/// Output all objects exists in current collection to excel document
		/// </summary>
		/// <param name="objRange"></param>
		internal void Output(Excel.Range objRange)
		{
			IEnumerator objIEnumerator = this.GetEnumerator();
			while(objIEnumerator.MoveNext())
				(objIEnumerator.Current as EQStyleBase).Output(objRange);
		}
	}
}
